<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8" />
	<title>JavaScript</title>
	<script type="text/javascript">
	
	</script>
</head>
<body>
    <script type="text/javascript">
	
	    <!-- 声明变量 -->
		var numble1;
		var numble2;
		var numble3;
		var numble4,numble5,numble6;
		
		<!-- 给变量赋值 -->
		numble1 = 120;
		numble2 = 130;
		numble3 = 223;
		
		<!-- 基本运算 -->
		numble4 = numble1 - numble2;
		numble5 = numble3 + numble2;
		numble6 = numble1 * numble2;
		
		<!-- 输出结果 -->
		console.log(numble4);  <!-- 控制台输出 --> 
		alert(numble5);   <!-- 浏览器弹出 -->
		document.write(numble6);   <!-- 页面显示 -->
		
		
		<!-- 用两种方式表达字符串 -->
		var string3 = 123;
		var string4 = "a";
		var string1 = "HelloWorld";
		var string2 = '你好';
		console.log(string1);
		alert(string1);

		var length = 16;              	          // Number 通过数字字面量赋值 
        var points = 3 * 10;                      // Number 通过表达式字面量赋值
        var lastName = "Johnson";                 // String 通过字符串字面量赋值
        var cars = ["Saab", "Volvo", "BMW"];      // Array  通过数组字面量赋值
        var person = {
		            firstName:"John",
		            lastName:"Doe",
					female:"men"
		}; 	                                      // Object 通过对象字面量赋值
       
   	    console.log(length);
		
		alert(points);
		
		document.write(lastName);
		
		document.write(cars[2]);   <!-- 从零开始 -->
		
		alert(cars.length);    <!-- 得到数组的长度 -->
		
		document.write(person.firstName);  <!-- 访问对象的属性方式一 -->
		
		document.write(person["lastName"]);   <!-- 访问对象的属性方式二 -->
	
	</script>
</body>
</html>
